package com.yupi.springbootinit.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.springbootinit.model.dto.user.UserLoginRequest;
import com.yupi.springbootinit.model.dto.user.UserRegisterRequest;
import com.yupi.springbootinit.model.dto.user.UserUpdateRequest;
import com.yupi.springbootinit.model.entity.User;
import com.yupi.springbootinit.model.vo.UserVO;

import javax.servlet.http.HttpServletRequest;

/**
 *
 */
public interface UserService extends IService<User> {

    /**
     * 登录功能
     * @param userLoginRequest
     * @param request
     * @return
     */
    UserVO UserLogin(UserLoginRequest userLoginRequest, HttpServletRequest request);

    /**
     * 注册功能
     * @param userRegisterRequest
     * @return
     */
    public long UserRegister(UserRegisterRequest userRegisterRequest);

    /**
     * 获取当前登录用户信息
     *
     * @return
     */
    UserVO getLoginUser(HttpServletRequest request);

    /**
     * 判断是否为管理员
     * @param request
     * @return
     */
    boolean isAdmin(HttpServletRequest request);

    /**
     * 写地址
     * @param address
     * @param loginUser
     * @return
     */
    boolean writeAddress(String address, UserVO loginUser);

    /**
     * 退出登录
     * @param request
     * @return
     */
    int UserLogout(HttpServletRequest request);

    /**
     * 更新用户信息需
     *
     * @param userUpdateRequest
     * @param loginUser
     * @return
     */
    boolean updateUser(UserUpdateRequest userUpdateRequest,UserVO loginUser);

}
